<template>
  <div id="centerLeft1">
    <div class="bg-color-black">
      <div class="d-flex pt-2 pl-2">
        <span>
          <icon name="chart-pie" class="text-icon"></icon>
        </span>
        <div class="d-flex">
          <span class="fs-xl text mx-2">反馈类型占比</span>
          <dv-decoration-1 class="dv-dec-1" />
        </div>
      </div>
      <dv-capsule-chart class="dv-cap-chart" :config="config" />
      <CenterLeft2Chart />
    </div>
  </div>
</template>

<script>
import CenterLeft2Chart from "@/components/echart/centerLeft/centerLeft2Chart";
import { queryFeedbackDeal } from "../api/index.js";
export default {
  data() {
    return {
      config: {
        data: [
          {
            name: '资金',
            value: 167
          },
          {
            name: '资产',
            value: 67
          },
          {
            name: '资源',
            value: 123
          },
          {
            name: '党务',
            value: 55
          },
          {
            name: '村务',
            value: 98
          },
          {
            name: '其他',
            value: 55
          }
        ],
        colors: ['#e062ae', '#fb7293', '#e690d1', '#32c5e9', '#96bfff'],
        unit: '数量',
        showValue: true

      }

    }
  },
  created() {
    this.getData()
  },
  methods: {
    getData() {
      let that = this;
      queryFeedbackDeal().then(res => {
        console.log(res)
        that.config.data[0].value = res.data.fundsNum
        that.config.data[1].value = res.data.assetsNum
        that.config.data[2].value = res.data.resourcesNum
        that.config.data[3].value = res.data.partyNum
        that.config.data[4].value = res.data.villageNum
        that.config.data[5].value = res.data.otherNum
        that.config = { ...that.config }
      })
    }
  },
  components: {
    CenterLeft2Chart
  },
};
</script>

<style lang="scss" scoped>
#centerLeft1 {
  $box-width: 300px;
  $box-height: 410px;
  padding: 16px;
  height: $box-height;
  min-width: $box-width;
  border-radius: 5px;
  .bg-color-black {
    height: $box-height - 30px;
    border-radius: 10px;
  }
  .text {
    color: #c3cbde;
  }
  .dv-dec-1 {
    position: relative;
    width: 100px;
    height: 20px;
    top: -3px;
  }
  .chart-box {
    margin-top: 16px;
    width: 170px;
    height: 170px;
    .active-ring-name {
      padding-top: 10px;
    }
  }
}
</style>